﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using MebAppMarketplace.Biz;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using MebAppMarketplace.Helpers;
using Microsoft.AspNetCore.Authorization;

namespace MebAppMarketplace.Controllers
{
    public class HomeController : Controller
    {
        public UserService userService { get; set; }
        public AppService appService { get; set; }
        public IActionResult Index(int page = 1, int size = 15)
        {
            var list = appService.HomeRecommended().GetList(page, size);
            return View(list);
        }

        public IActionResult InitializeApplication()
        {
            userService.InitializeAdmin();
            return this.JsonOk();
        }
    }
}
